import time
import selenium
from selenium.webdriver import chrome
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.support import expected_conditions as ec
from selenium.webdriver.common.by import By
from test_case.fanwei_login import fanwei_login

# driver = fanwei_login()

def chongzhi(driver):
    #从首页点击充值
    # driver.find_element(By.XPATH,"//*[@class='user_money']/a[1]").click()
    #从我的P2P信贷页面点击充值
    #点击资金管理
    driver.find_element(By.XPATH,'//*[@id="uc_cate"]/div[2]').click()
    #点击充值
    driver.find_element(By.XPATH,'//*[@id="uc_cate"]/div[3]/ul/li[1]/a').click()
    ass_title = driver.title
    print(ass_title)

    try:
        ass_el = WebDriverWait(driver,5).until(ec.visibility_of(driver.find_element(By.XPATH,"//*[@value='确定充值']")))
    except:
        ass_el = False
    return ass_title,ass_el

# print(chongzhi(driver))